import request from '@/router/axios';
import GLOBAL from '@/const/global_variable'
export const loginByUsername = (username, password, code, redomStr) => request({
    url: GLOBAL.proxyUrl + 'api/wf/signIn',
    method: 'post',
    meta: {
        isToken: false,
        isUid: false
    },
    data: {
        "name": username,
        password,
        code,
        redomStr
    }
})

export const getUserInfo = () => request({
    url: '/user/getUserInfo',
    method: 'get'
});

export const refeshToken = () => request({
    url: '/user/refesh',
    method: 'post'
})

export const getAuthMenus = () => request({
    url: GLOBAL.proxyUrl + 'api/wf/getAuthMenus',
    meta: {
        isToken: true,
        isUid: true
    },
    method: 'post',
});

export const getMenu = (type = 0) => request({
    url: '/user/getMenu',
    method: 'get',
    data: {
        type
    }
});

export const getTopMenu = () => request({
    url: '/user/getTopMenu',
    method: 'get'
});

export const sendLogs = (list) => request({
    url: '/user/logout',
    method: 'post',
    data: list
})

export const logout = () => request({
    url: GLOBAL.proxyUrl + 'api/wf/signOut',
    meta: {
        isToken: true,
        isUid: true
    },
    method: 'get'
})
